home *** CD-ROM | disk | FTP | other *** search
- /*
- * $RCSfile: volume.h,v $
- * $Revision: 1.1.1.1 $
- * $Date: 1996/05/04 21:55:46 $
- */
- #ifndef __VOLUME_H__
- #define __VOLUME_H__
-
- /**********************************************************************
- * EXODUS Database Toolkit Software
- * Copyright (c) 1991 Computer Sciences Department, University of
- * Wisconsin -- Madison
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
- * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
- * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
- * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * The EXODUS Project Group requests users of this software to return
- * any improvements or extensions that they make to:
- *
- * EXODUS Project Group
- * c/o David J. DeWitt and Michael J. Carey
- * Computer Sciences Department
- * University of Wisconsin -- Madison
- * Madison, WI 53706
- *
- * or exodus@cs.wisc.edu
- *
- * In addition, the EXODUS Project Group requests that users grant the
- * Computer Sciences Department rights to redistribute these changes.
- **********************************************************************/
- #include "ess.h"
- #include "checking.h"
- #include "io.h"
- #include "bf.h"
- #include "list.h"
- #include "link.h"
-
- #include "VOLIDCLASS.h"
- #include "forward.h"
- #include "resources.h"
-
- /*
- * this needs the definition of VOLUME_TABLE_MAX_SIZE
- */
- #include "queues.h"
-
- #ifndef DISKPROC_MAKE
-
- typedef struct {
- FLAGS volflags; /* volflags and properties */
- int numCylinders, tracksPerCylinder, pagesPerTrack,
- numLogFileBlocks, logFileBlock2size;
- } FORMATINFO;
-
- class VOLNAMEREC {
- public:
- VOLUMENAME volName;
- VOLID volid;
- LIST nameHashList;
- LIST volidHashList;
- FORMATINFO *fmtinfo;
-
- void Dump(FILE *f);
- VOLIDCLASS *keylocation (int unique, VOLIDCLASS **unused);
- VOLUMENAME *keylocation (int unique, VOLUMENAME **unused);
- LISTELEMENT *listlocation (int unique);
- void ReInit();
- void Init();
- };
-
- /*
- * the in-memory structure that holds a disk header
- */
- class VOLREC {
- public:
- VOLID volid; /* Hate to have it copied from header->volid,
- * but the HashTable funcs need to have the
- * key located in the structure
- */
- VOLHDR *header;
- GROUPLINK *headerLink;
- BOOL dirty;
- LINK *volLink;
- /*
- DIRROOT *rootPage;
- char *freeBitmap;
- char *uniqueBitmap;
- char *slotBitmap;
- char *fileBitmap;
- */
- int index;
- LATCH latch;
- LIST openList;
- LIST tcbList;
- LIST activeTransList;
- LISTELEMENT hashList;
- FLAGS volflags;
- BUFGROUP *bufGroup;
- SHORTPID lastAllocPage;
- VOLNAMEREC *volNameRec;
- QUEUEPAIR *queues;
- pid_t diskrwPid;
- int fd; /* file descriptor of opened disk volume
- * used for "fast" path
- */
-
- inline BOOL equalFunc(VOLREC *other) const {
- return other->volid == this->volid;
- };
- inline int hashFunc() const { return (int)(this->volid); };
- void Dump(FILE *f);
- VOLIDCLASS *keylocation (int unique, VOLIDCLASS **unused);
- LISTELEMENT *listlocation (int unique);
- void ReInit();
- void Init();
- };
-
-
- /*
- * define states of the record
- * NB: VOLPROP* had better fit nicely in to this!
- */
- #define VOL_FREE 0x0 /* entry is free */
- #define VOL_TEMP VOLPROP_TEMP
- #define VOL_RAWDEV 0x2
- #define VOL_LOG VOLPROP_LOG
- #define VOL_OPEN 0x10 /* the volume contains a mounted entry */
- #define VOL_INIT 0x20 /* the volume connections are initing */
- #define VOL_INVALID 0x40 /* the link to the diskproc is invalid */
- #define VOL_QUIESCE 0x80 /* the volume is being closed */
- #define VOL_FORMAT 0x100 /* volume is in table for formatting only */
- #define VOL_DISPLAY 0x200 /* used for displaying format (by formatvol only) */
-
-
- /*
- * structure that joins links and disks
- */
- typedef struct {
-
- VOLID volid;
- VOLREC *volRec;
- LINK *link;
- LISTELEMENT linkList;
- LISTELEMENT volList;
-
- } VOLINFO;
-
-
- /*
- * Structure logged at checkpoint to record all mounted volumes
- */
- typedef struct {
- VOLID volid;
- _VOLUMENAME_ volName;
- } VOLIDNAME;
-
- #endif DISKPROC_MAKE
- #endif __VOLUME_H__
-